/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __PQ_GlobalVariables_H__
#define __PQ_GlobalVariables_H__

#include "ClientPrerequisites.h"

namespace PQClient
{
	/*Singleton class that manage all global(very important) variables.
	All global important config variables,scene state,...,are keep here.
	*/
	class GlobalVariables
	{
	protected:
		GlobalVariables();
	public:
		static GlobalVariables& getSingleton()
		{
			static GlobalVariables inst;
			return inst;

		}
		
		/*Set int32 type globals.
		*/
		void setInt32(Int32VarId id,int32 value);

		int32 getInt32(Int32VarId id);

		void setString(StringVarId id,std::string value);

		std::string getString(StringVarId id);

		

		RunningState getRunningState(SceneId id);

		//Get current running state
		RunningState getRunningState();

		SceneId getActiveSceneId();

	protected:
		friend class NetManager;
		friend class GameScene;
		//This function only can be called by the allowed
		//caution: this function will change the program flow
		void setActiveSceneId(SceneId id);

		/*
		Set scene running state.
		*/
		void setRunningState(SceneId id,RunningState value);

	protected:
		int32 _int32Vars[Int32_Var_Count];
		std::string _strVars[String_Var_Count];
		RunningState _states[Scene_Count];


	};

}

#define Globals PQClient::GlobalVariables::getSingleton()
#endif
